package org.example.core.web;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * 分页查询返回结果
 * @author Calvin
 */
@Setter
@Getter
public class PageResult<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(name = "当前页数据")
    private List<T> list;

    @Schema(name = "总数量")
    private Long count;

    public PageResult() {
    }

    public PageResult(List<T> list) {
        this(list, null);
    }

    public PageResult(List<T> list, Long count) {
        setList(list);
        setCount(count);
    }

}
